# -*- coding:utf-8 -*-
"""
Created on 4 mars 2010

@author: Alicia
"""
import tkMessageBox #tkMessageBox.showinfo

def checkcube(atnb,Elm):
    affiche="Please run CUBEGEN for the atoms:\n"
    count=0
    for el in atnb:
        path="data/"+Elm[el]+".cube"
        try:
            f=open(path,'r')
            f.close()
            print ".cube of ",Elm[el],"exists"
        except:
            #print "can't find the .cube of ", Elm[el]
            affiche=affiche+Elm[el]+', '
            count+=1
            if count%10==0 and count!=0:
                affiche+='\n'
    if count==0:
        tkMessageBox.showinfo("OK",
                              "All the .cube of the atoms of the molecule exist.\nThen you can draw the contours for the promolecule.")
    else:
        title = "Missing "+str(count)+" .cube"
        print title
        affiche += '\n'+"the number of steps in each direction should be 99.\n"+\
        "Then put the .cube file in the directory \\src\\data."
        print affiche
        tkMessageBox.showinfo(title,affiche)
        
    
